
//筛选栏
document.querySelector('.content').onclick=function (event){
   var ele = event.target;
   console.log(ele.nodeName);
   var Aarrs = document.querySelector(".location_a").parentElement.children;
   console.log(Aarrs.length)
   for (let i = 0; i < Aarrs.length; i++) {
        Aarrs[i].style.color = "#414a60";
    }
   ele.style.color = '#00d7c6'
}

document.querySelector('.content_b').onclick=function (event){
    var ele = event.target;
    console.log(ele.nodeName);
    var Aarrs = document.querySelector(".location_b").parentElement.children;
    console.log(Aarrs.length)
    for (let i = 0; i < Aarrs.length; i++) {
        Aarrs[i].style.color = "#414a60";
    }
    ele.style.color = '#00d7c6'
}

document.querySelector('.content_c').onclick=function (event){
    var ele = event.target;
    console.log(ele.nodeName);
    var Aarrs = document.querySelector(".location_c").parentElement.children;
    console.log(Aarrs.length)
    for (let i = 0; i < Aarrs.length; i++) {
        Aarrs[i].style.color = "#414a60";
    }
    ele.style.color = '#00d7c6'
}

document.querySelector('.content_d').onclick=function (event){
    var ele = event.target;
    console.log(ele.nodeName);
    var Aarrs = document.querySelector(".location_d").parentElement.children;
    console.log(Aarrs.length)
    for (let i = 0; i < Aarrs.length; i++) {
        Aarrs[i].style.color = "#414a60";
    }
    ele.style.color = '#00d7c6'
}

//固定选择框
window.addEventListener('scroll', function(){
    let t = $('body, html').scrollTop();   // 目前监听的是整个body的滚动条距离
    var s = document.querySelector('.top-filter-bar');
    console.log(t)
    if(t>337){
        $('.top-filter-bar').addClass('top-fixed')
        s.style.height = '49px';
    }else {
        s.style.height = '0px';
        $('.top-filter-bar').removeClass('top-fixed')
    }
})



